from moviepy.editor import *

inPath = r'E:\songhq\video\car_concatenate.mp4'
outPath = r'E:\songhq\video\car_concatenate_word.mp4'

if __name__ == '__main__':
    clip = VideoFileClip(inPath)
    print(TextClip.list('font'))
    # 添加文本
    text_clip = TextClip("端午节六折大甩卖！", fontsize=70, color="red", font='simfang.ttf')
    text_clip = text_clip.set_position((800, 50)).set_duration(3)
    final_clip = CompositeVideoClip([clip, text_clip])
    reversed_video = final_clip.fx(vfx.time_mirror) # 倒放视频
    reversed_video.write_videofile(outPath)
